package com.gupao.simpleFactory;

public class MilkFactory {
    /*public static Milk create(String milkName){
        if(milkName.equals("蒙牛")){
            return new MengNiu();
        }
        return null;
    }*/

    public static Milk create(Class clazz) throws IllegalAccessException, InstantiationException {
        Milk milk = (Milk) clazz.newInstance();
        return milk;
    }
}
